<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/functions' prefix='fn' %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<c:url value="/player/new.html" var="createPlayer"/>
<c:url value="/resources/jQuery/jquery-1.7.2.min.js" var="jquery"/>
<c:url value="/resources/jQuery/jquery-ui-1.8.21.custom.min.js" var="jqueryUI"/>
<c:url value="/resources/css/cupertino/jquery-ui-1.8.21.custom.css" var="jQueryCSS" />


<script type="text/javascript" src="${jquery}" ></script>
<script type="text/javascript" src="${jqueryUI}" ></script>
<link type="text/css" href="${jQueryCSS}" rel="Stylesheet" />

<script type="text/javascript">
	 $(document).ready(function(){
		 	 
	 });
</script>

<style>
body {
  background-color: #B6BCFA;
}

table {
  border-style: solid;
  border-width: 2px;
  border-color: 7465BF;
  width: 50%;
}

table td {
  text-align: center;
}

tr {
  padding: 0px;
  height: 20px;
}


tr.odd {
  background-color: #B6BCFA;
}

tr.odd td {
  padding:0;
}
</style>


<html>
  <body>
   <jsp:include page="templates/header.jsp"></jsp:include>
    <h4 style="margin-top: 0px;">Contact page for ${contact.fullName}</h4>
    
    <div id="personalInfo">
      <p>First Name: ${contact.firstName}<br/>
      Last Name: ${contact.lastName}<br/>
      Email: ${contact.email}
      <c:if test="${principal.email == contact.email}">
        <br/>Password: <a href="changePassword.html?id=${contact.contactID}">Click here to change password</a>
        </c:if></p> 
    </div>
    
    <div id="locationsPOC"> 
      <c:if test="${fn:length(locationsPOC) > 0}">
      <h5>Location POCs:</h5>
      <p>
      <c:forEach items="${locationsPOC}" var="local" varStatus="loopVar">
        ${loopVar.index + 1}. Street Address: ${local.fullAddress}<br/>
        <br/>
      </c:forEach>
      </p>
      </c:if>
    </div>
    
    <div id="adminLeagues">
      <c:if test="${fn:length(adminLeagues) > 0}">
      <h5>Running Leagues:</h5>
      <c:forEach items="${adminLeagues}" var="league">
        <a href="../league/view.html?name=${league.encodedName}">${league.leagueName}</a><br/>
      </c:forEach>
      </c:if>
    </div>
    
    <div id="coachedTeams">
      <c:if test="${fn:length(coachedTeams) > 0}">
      <h5>Coaching Teams:</h5>
      <c:forEach items="${coachedTeams}" var="team">
        <a href="../team/view.html?name=${team.encodedName}">${team.name}</a><br/>
      </c:forEach>
      </c:if>
    </div>
    
    <div id="playedTeams">
      <c:if test="${fn:length(playedTeams) > 0}">
        <h5>Playing For Teams:</h5>
        <table>
        <tbody>
        <tr><th>Team</th><th>Position</th></tr>
        <c:forEach items="${playedTeams}" var="player" varStatus="loopVar">    
        <tr><td>${player.team.name}</td><td>${player.player.position}</td></tr>
        </c:forEach>
        </tbody>
        </table>
      </c:if>
    </div>
    
    
  </body>
</html>